package com.ideaaedi.zoo.example.springboot.flowable.sharding.controller.helper.entity.req;

import com.ideaaedi.zoo.example.springboot.flowable.sharding.controller.helper.entity.BaseDTO;
import com.ideaaedi.zoo.example.springboot.flowable.sharding.controller.helper.entity.enums.LeaveApprovalState;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;
import java.util.Map;

@Data
@EqualsAndHashCode(callSuper = true)
public class DemoLeaveInfoCompleteReqVO extends BaseDTO {
    
    @NotNull(message = "userId cannot be null.")
    @Schema(description = "完成任务的用户id")
    private Long userId;
    
    @NotNull(message = "taskId cannot be null.")
    @Schema(description = "工作流任务id")
    private String taskId;
    
    @NotNull(message = "approvalState cannot be null.")
    @Schema(description = "流转至的审批状态")
    private LeaveApprovalState approvalState;
    
    @Schema(description = "表单参数")
    private Map<String, Object> formData;
    
    @Schema(description = "评论")
    List<String> commentList;
    
    @Valid
    @Schema(description = "附件")
    List<AttachmentDTO> attachmentList;
    
    @Data
    public static class AttachmentDTO {
        
        @NotBlank(message = "name cannot be null.")
        @Schema(description = "附件名称")
        private String name;
    
        @NotNull(message = "fileId cannot be null.")
        @Schema(description = "附件id")
        private Long fileId;
    
        @Schema(description = "附件类型")
        private String type = "default";
    
        @Schema(description = "附件类描述")
        private String description;
    }

}